package com.group2.mapper;

import com.group2.bean.StayTimeBySourceBean;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 高耀
 * @date 2024/12/17 17:14<p></p>
 */
@Mapper
public interface StayTimeBySourceMapper {
    @Select("select \n" +
            "source_name, \n" +
            "round(sum(total_during_time) / sum(total_session_count), 2) as during_time\n" +
            "from \n" +
            "dws_traffic_vc_source_ar_is_new_page_view_window\n" +
            "partition par#{date} \n" +
            "group by `source_name`")
    public List<StayTimeBySourceBean> selectStayTimeBySource(Integer date);
}
